<?php

/**
 * @author christian
 * @copyright 2011
 * @abstract carga de todo el itinerario que es parte de un tour del itenario del tour
 */
 
 

$ruta=$_SERVER['DOCUMENT_ROOT']."/viventura"."/MDGuide";
$ruta2=$_SERVER['DOCUMENT_ROOT']."/viventura"."/MDTour";
include_once("$ruta/conf/CConfig.php");
include_once("$ruta/elements/head.tpl");
include_once("$ruta/view/CTableDraw.php");
include_once("$ruta/view/CDrawMenuTour.php");
include_once("$ruta2/MDTourGeneral/CDrawPageReg.php");
include_once("$ruta/star.php");


if (!isset($_GET['idCit'])) {$_GET['idCit'] = "NULL"; }
if (!isset($_GET['default'])) {$_GET['default'] = "NULL"; }
if (!isset($_GET['nval'])) {$_GET['nval'] = "NULL"; }

$idCit = $_GET['idCit'];
$nval = base64_decode($_GET['nval']);

$titOpe="";$filter="";
if($idCit!="NULL"){
    $titCit = " en el área de <em>$nval</em> ($idCit)";
    $filter = "where CITY_idCit =$idCit";

}

$default= $_GET['default'];

$instance=new CDrawMenuTour;
$table = new CTableDraw;

CDrawMenuTour::getInstance()->rigth_side_begin();//empieza lado derecho 
CDrawMenuTour::getInstance()->DrawDivAdBegin("content_area_user_title","1");echo "<h1>Paquetes turísticos".$titOpe."</h1>";


    if($default==17){    
        $columnas=array("idGuide"=>"id","NomApe"=>"Nombres y Apellidos","DocNumGui"=>"Número de documento","MailGui"=>"Correo electrónico","WebPagGui"=>"Página web","TelGui"=>"Teléfono","GuiorTc"=>"Guia/TC","CUENTA_IdCue"=>"Cuenta","CITY_idCit"=>"Ciudad");
        $table->DrawTable("","guidetc",$columnas,$default);
        }
    else{        
        $columnas=array("idGuide"=>"id","NomApe"=>"Nombres y Apellidos","DocNumGui"=>"Número de documento","MailGui"=>"Correo electrónico","WebPagGui"=>"Página web","TelGui"=>"Teléfono","GuiorTc"=>"Guia/TC","CUENTA_IdCue"=>"Cuenta","CITY_idCit"=>"Ciudad");
        $table->DrawTable("","guidetc",$columnas,$default);
        }


CDrawPageReg::getInstance()->DrawButton("Añadir servicio","MDGuideData/GuideServices/CGuideServicio.php");

/////////////////Area de registro /////////////////////
CDrawPageReg::getInstance()->DrawHideSectionBeg();
    
    echo "<p align='center'>";
    $action="/viventura/MDGuide/view/CRegistroGuide.php?default=1";$name="formulario_registro";$method="post";$NAME="REGISTRO DE TOUR CONDUCTOR";
    CDrawPageReg::getInstance()->DrawHead($action,$name,$method,$NAME);
    echo "</p>";
    CDrawPageReg::getInstance()->readOnly("guidetc","idGuide");
    
    echo "<h2>Operador</h2>";
    echo "<div id='dashboard_info'>";

    $city = array("idCit"=>"idCit", "NamCit"=>"NamCit");
    CDrawPageReg::getInstance()->DrawSelect("city", $city, "Ciudad","idCit");
        
        //CDrawPageReg::getInstance()->DrawHideSectionIBeg();
        
        
 //       include_once("$ruta2/Ciudad/ciudad.php");
        
        //CDrawPageReg::getInstance()->DrawHideSectionIEnd("Añadir ciudad / Ocultar");

    echo "</div>";
//--Textos completos 	idGuide 	FirstNamGui 	LastNamGui 	BornDateGui 	
//cNumGui 	TelGui 	FaxGui 	MailGui 	WebPagGui 	LimBloGui 	LimResGui 	
//PricPerSer 	ClasGui 	GuiOrTc 	DescGui 	CUENTA_idCue 	CUENTA_BANCO_idBan 	CITY_idCit
   
    
       echo "<h2>Datos generales</h2>";
    $val_cguide = array(":required",":required",":integer");
    $cguide=array("FirstNamGui"=>"Nombres","LastNameGui"=>"Descripción","DocNumGui"=>"Número de documento");
    CDrawPageReg::getInstance()->DrawTextBox($cguide, $val_cguide);
    
     CDrawPageReg::getInstance()->SimpleDate("Fecha de nacimiento","BornDateGui");
    
       echo "<h2>Datos de reserva</h2>";
    $val_bguide = array(":integer",":integer",":integer");
    $bguide=array("LimBloGui"=>"Límite bloqueo","LimResGui"=>"Límite de reserva","PricPerSer"=>"Precio del servicio");
    CDrawPageReg::getInstance()->DrawTextBox($bguide, $val_bguide);
    
       echo "<h2>Datos de contacto</h2>";
    $val_tguide = array(":integer",":integer",":email",":url");
    $tguide=array("TelGui"=>"Telefono","FaxGui"=>"Fax","MailGui"=>"Correo electrónico","WebPagGui"=>"Página web");
    CDrawPageReg::getInstance()->DrawTextBox($tguide, $val_tguide);
    
   
        echo "<h2>Cuenta Bancaria</h2>";
    
    //include_once("$ruta2/MDBanCuen/Cuenta.php");
        

      
    echo "<p align='right'>";
    CDrawPageReg::getInstance()->DrawSubmmit("Añadir");
    echo "</p>";
    echo "</div>";


 CDrawPageReg::getInstance()->DrawHideSectionEnd("Añadir paquete / Ocultar");

CDrawPageReg::getInstance()->DrawFoot();


CDrawMenuTour::getInstance()->rigth_side_end();

 if($default==17){    
        CDrawPageReg::getInstance()->DrawButton("Ver lista de TC y guías","index.php");
        }
 else{  echo "</div>";       
        CDrawPageReg::getInstance()->DrawButton("Ver bloqueos","index.php?default=17");
        echo "</div>";
        }
   
CDrawMenuTour::getInstance()->DrawDivAdEnd();




////////////Fin del area de registro////////////////

  
?>


<script type="text/javascript">
   function ver_confirm() 
   {
      var name=confirm("¿Desea terminar con el registro? Los datos ingresando actualmente no se guardaran hasta que haya pasado a la siguiente ventana ")
      if (name==true) {
        parent.location.href = '/viventura/MDTour/MDTourGeneral/MDPasajeros/MDPasajeros.php?codigo=<?php echo $id;?>';
      }
      else {
      }
   }
</script>